package com.lx.book.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lx.book.entity.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface BookMapper extends BaseMapper<Book> {
    @Insert("insert into book values(null,#{name},#{price},#{category},#{pnum},#{imgurl},#{description},#{author},#{sales})")
    boolean addBook(Book book);

    boolean delBook(Integer[] id);

    @Select("select * from book where id=#{id}")
    Book all(Integer id);

    boolean update(Book book);
}
